package com.xzx.shop_front_api.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.xzx.shop_front_api.entity.Address;
import com.xzx.shop_front_api.entity.District;
import com.xzx.shop_front_api.entity.Members;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 会员mapper类
 */
@Mapper
public interface MembersMapper {
    //新增会员
    public int insertMembers(Members members);
    //根据用户名查询账号信息
    public Members getMembersByUsername(String username);
    //修改密码
    public int updatePassword(String username, String password);
    //修改支付密码
    public int updatePayPassword(int id, @Param("payPassword") String payPassword);
    //根据id获取
    public Members getMembersById(int id);

    //根据用户名查询账号信息
    public Members getMembersByMobile(String username);
    //更新手机号码
    public int updateMobile(int id, @Param("mobile") String mobile);

    //修改个人信息
    public int updateMyInfo(int id,
                            @Param("username") String username,
                            @Param("nickname") String nickname,
                            @Param("gender") int gender,
                            @Param("birthday") String birthday
                            );
    //更新头像
    public int updateLogo(int id, @Param("logo") String logo);
    //更新认证
    public int updateIsAuth(int id, @Param("isAuth") int isAuth);
    //查询认证信息
    public Members getMemberWithIdCard(int id);

    public List<District> getDistrictBypId(int pId);
    //新增收货地址
    public int insertAddress(Address address);

    //更新收货地址默认值
    public int updateDefaultedAddress(@Param("memberId") int memberId, @Param("isDefaulted") int isDefaulted);
    //根据用户id查询收件地址信息
    public List<Address> getMembersAddressListByMemberId(int memberId);

    //根据id查询地区名称
    public District getDistrictById(int id);
    //根据id删除收件地址
    public int deleteAddressById(int id);
    //根据id查询收件地址
    public Address getAddressById(int id);


}
